package com.fingard.dsp.bank.reqrespobj.foreignexchange;

import com.fingard.dsp.bank.reqrespobj.ReqRespHeader;
import com.fingard.dsp.bank.reqrespobj.RequestBase;
import com.fingard.dsp.bank.reqrespobj.foreignexchange.detail.ReqFX01Detail;
import com.fingard.xml.XmlTextReader;

/**
 * Created by F on 2018/11/19.
 */
public class ReqFX01 extends RequestBase {
    public ReqFX01Detail singleDetail = null;

    private XmlTextReader xmlReader;

    public ReqFX01(XmlTextReader p_xmlReader, ReqRespHeader p_header) throws Exception{
        init(p_xmlReader, p_header);
    }
    private void init(XmlTextReader p_xmlReader, ReqRespHeader p_header) throws Exception{
        reqHeader = p_header;
        xmlReader = p_xmlReader;

        if(xmlReader.read(PATH_Detail)){//"/ATSYH/TransReq/TransParam/DetailRecord"
            singleDetail = new ReqFX01Detail(xmlReader.readedXElement, reqHeader.transType,p_header.bankCode);
        }
        else{
            throw new Exception("不存在节点："+PATH_Detail);
        }
    }
    public String getOriReqXml(){
        return xmlReader.getOriXmlString();
    }
}
